import { Children, lazy } from 'react'
import { Navigate } from 'react-router-dom'
import Home from '../page/home/Index'
import Login from '../page/login/Index'
import Error from '../page/404/Index'
let Order = lazy(() => import('../page/order/Index'))
let User = lazy(() => import('../page/user/Index'))
export const homeo = [
    {
        path: '/home/order',
        element:<Order></Order>
    },
    {
        path: '/home/user',
        element:<User></User>
    }
]
const router = [
  {
    path: "/",
    element: <Navigate to={"/home/order"}></Navigate>,
  },
  {
    path: "/home",
    element: <Home></Home>,
    children: homeo,
  },
  {
    path: "/login",
    element: <Login></Login>,
  },
  {
    path: "*",
    element: <Error></Error>,
  },
];
export default router